package com.ctshk.rpc.airexpress.mapper;

import com.ctshk.rpc.airexpress.base.CustomBaseMapper;
import com.ctshk.rpc.airexpress.entity.AirportExpressInitializationSettings;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 机场快线api初始化设置表 Mapper 接口
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-02-18
 */
public interface AirportExpressInitializationSettingsMapper extends CustomBaseMapper<AirportExpressInitializationSettings> {
    @Delete("delete from t_airport_express_initialization_settings")
    int deleteAll();

    @Select("select id, supplier_id, supplier_name, service_charge, service_charge_type, adult_one_way_price_type, adult_one_way_price, adult_round_trip_price_type, adult_round_trip_price, children_one_way_price_type, children_one_way_price, gmt_create, create_id, gmt_modified, modified_id,is_deleted from t_airport_express_initialization_settings")
    AirportExpressInitializationSettings selectAll();

    @Select("SELECT aeis.service_charge, aeis.service_charge_type, aeis.adult_one_way_price, aeis.adult_one_way_price_type, aeis.children_one_way_price, aeis.children_one_way_price_type, aeis.adult_round_trip_price, aeis.adult_round_trip_price_type " +
            "FROM t_airport_express_initialization_settings aeis, t_airport_express_initialization_settings_channel aeisc " +
            "where aeis.id = aeisc.setting_id and is_deleted = 0 and aeisc.channel_id = #{channelId}")
    AirportExpressInitializationSettings selectCheckSetting(@Param("channelId")int channelId);
}
